<template>
  <div>
    <view class="imgBox w90">
      <image
        :src="item.image"
        mode=""
        class="imgStyle"
        v-for="item in imgArr"
        :key="item.id"
        @click="navToZhuan(item.id)"
      />
    </view>
  </div>
</template>
<script>
  import home from '@/services/public'
  export default {
    data() {
      return {
        imgArr: []
      }
    },
    onShareAppMessage() {
      let path = '/pages/productDetails/index?id=' + this.params.id
      if (uni.getStorageSync('userId')) {
        path = path + '&userId=' + uni.getStorageSync('userId')
      }
      return {
        title: '我在这里发现了一个好玩的，快来看看',
        path,
        imageUrl: '',
        desc: '描述',
        content: '内容'
      }
    },
    methods: {
      specialZoneList() {
        home.moduleList().then(res => {
          this.imgArr = res.list
        })
      },
      navToZhuan(id) {
        wx.navigateTo({
          url: `/pages/productList/index?moduleId=${id}`
        })
      }
    },
    mounted() {
      this.specialZoneList()
    }
  }
</script>
<style lang="scss" scoped>
  .w90 {
    width: 90%;
    margin: 0 auto;
  }
  .imgStyle {
    width: 100%;
    height: 290rpx;
    margin-top: 40rpx;
    border-radius: 40rpx;
  }
</style>
